import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.ImageIcon;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;


/*
 * MainFrame.java
 *
 * 
 */

/**
 *
 * @author  郑瑞召
 */
public class MainFrame extends javax.swing.JFrame {

	/** Creates new form MainFrame */
	public MainFrame() {
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jPanel1 = new GetPanel(872,567,System.getProperty("user.dir")+"/picture/bg/Mainframe.jpg");
		jLabel1 = new javax.swing.JLabel();
		jButton1 = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();
		jButton3 = new javax.swing.JButton();
		jButton4 = new javax.swing.JButton();
		
		setResizable(false);
		
		ImageIcon icon=new ImageIcon(System.getProperty("user.dir")+"/picture/icon/fav.jpg");//
		setIconImage(icon.getImage());
		setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);

		jLabel1.setFont(new java.awt.Font("微软雅黑", 1, 36));
		jLabel1.setText("\u77e9\u9635\u8f6c\u6362\u6559\u5b66\u8f85\u52a9\u7cfb\u7edf");

		jButton1.setText("图片展示：矩阵知识讲解");

		jButton2.setText("jButton2");

		jButton3.setText("jButton3");

		jButton4.setText("jButton4");

		javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
				jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel1Layout.createSequentialGroup().addGap(71, 71, 71)
						.addComponent(jButton1,
								javax.swing.GroupLayout.DEFAULT_SIZE, 81,
								Short.MAX_VALUE).addGap(31, 31, 31)
						.addComponent(jButton2,
								javax.swing.GroupLayout.DEFAULT_SIZE, 81,
								Short.MAX_VALUE).addGap(33, 33, 33)
						.addComponent(jButton3,
								javax.swing.GroupLayout.DEFAULT_SIZE, 81,
								Short.MAX_VALUE).addGap(15, 15, 15)
						.addComponent(jButton4,
								javax.swing.GroupLayout.DEFAULT_SIZE, 81,
								Short.MAX_VALUE).addGap(261, 261, 261))
				.addGroup(
						jPanel1Layout.createSequentialGroup()
								.addGap(92, 92, 92).addComponent(jLabel1,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										409,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addGap(234, 234, 234)));
		jPanel1Layout
				.setVerticalGroup(jPanel1Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel1Layout
										.createSequentialGroup()
										.addGap(46, 46, 46)
										.addComponent(
												jLabel1,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												57,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(213, 213, 213)
										.addGroup(
												jPanel1Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.CENTER,
																false)
														.addComponent(jButton1)
														.addComponent(jButton2)
														.addComponent(jButton3)
														.addComponent(jButton4))
										.addGap(50, 50, 50)));

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addComponent(
				jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE,
				872, Short.MAX_VALUE));
		layout.setVerticalGroup(layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addComponent(
				jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 567,
				Short.MAX_VALUE));
		jButton1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				Huandeng huandeng = new Huandeng();
				huandeng.setVisible(true);
				
			}
		});
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e){
				if(MessageBox.Show("真的要退出吗？",12)==0){
					System.exit(0);
				}
			}
		});
		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	/**
	 * @param args the command line arguments
	 * @throws UnsupportedLookAndFeelException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException 
	 */
	public static void main(String args[]) throws ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
		UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				
				MainFrame mainframe =	new MainFrame();
				mainframe.setVisible(true);
			}
		});
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton jButton1;
	private javax.swing.JButton jButton2;
	private javax.swing.JButton jButton3;
	private javax.swing.JButton jButton4;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JPanel jPanel1;
	// End of variables declaration//GEN-END:variables

}